
import 'package:demo202112/MyNavigator/wy_paged.dart';
import 'package:flutter/material.dart';

/**
 * @Author wywinstonwy
 * @Date 2022/1/10 9:48 下午
 * @Description:
 */

class PageC extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

    return Center(
      child: Card(
        child: Column(
          children: <Widget>[
            _buildItem(Icons.clear, '不感兴趣', '减少这类内容',),
            Divider(),
            _buildItem(Icons.access_alarm, '举报', '标题夸张，内容质量差 等',
                showArrow: true, onPress: () {
                  Navigator.of(context).push(MaterialPageRoute(builder: (context) {
                    return PageD();
                  }
                  )
                  );
                }),
            Divider(),
            _buildItem(Icons.perm_identity, '拉黑作者：汽车执行', '', ),
            Divider(),
            _buildItem(Icons.account_circle, '屏蔽', 'seqing视频、驾驶员等',),
          ],
        ),
      ),
    );
  }



  _buildItem(IconData iconData, String title, String content,
      {bool showArrow = false,  Function() ? onPress}) {
    return Row(
      children: <Widget>[
        Icon(iconData),
        SizedBox(
          width: 20,
        ),
        Expanded(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Text(
                title,
                style: TextStyle(fontSize: 18),
              ),
              Text(
                content,
                style: TextStyle(
                    color: Colors.black.withOpacity(.5), fontSize: 14),
              )
            ],
          ),
        ),
        !showArrow
            ? Container()
            : IconButton(
          icon: Icon(Icons.arrow_forward_ios),
          iconSize: 16,
          onPressed:  onPress,
        ),
      ],
    );
  }
}